Skip to content

test(typegen): event-route inputs register the optional preflight key (#664 follow-up) - #670

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/main-red-656-664
Sep 6, 2026
Merged

test(typegen): event-route inputs register the optional preflight key (#664 follow-up)#670
ScriptedAlchemy merged 2 commits into
mainfrom
fix/main-red-656-664

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes the last red test on main after #664 (route-register-typegen.test.ts in Verify (integration-2), run 34006833369).

Cause

#664 added preflight?: Preflight to AgentEventRouteProps (and the harness's AgentEventRouteInput), so the generated routes.d.ts registers an event route's input as { canonical, native, preflight? }. The typegen test still asserted keyof RegisteredRouteInput<'event:tool/after'> equals 'canonical' | 'native' — a superseded contract, not a product bug. #664's gate ran the unit pool and three integration files but not this one.

The other five failures from that run (prepack.test.ts ×3, route-invocation-dev-server.test.ts ×2, all from #656) were fixed concurrently by #667 (packed paths resolve from the npm root) and #669 (watcher ignores the package build's .dist.compile- scratch dir). Verified independently here: instrumenting the watcher showed DBG-INVALIDATION [".dist.compile-XXXXXX"] triggering the spurious republish that moved pluginRoot and dropped the operator .env layer.

Change

One assertion in packages/agent-bundle/tests/route-register-typegen.test.ts: the registered event-route input keys are 'canonical' | 'native' | 'preflight'. Plus the matching prose in website/docs/{en,zh}/guide/development/testing.mdx ({ canonical, native, preflight? }). Tests and docs only; skip-changeset.

Local merge gate

Branch contains origin/main at e4c5e26de3 (#669).

pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit     # ok, ok, ok (1432 files, 88 rules), 4272 passed
AGENT_BUNDLE_WORKBENCH_PREBUILT=1 AGENT_BUNDLE_PACKAGE_PREBUILT=1 pnpm exec rstest --config rstest.integration.config.ts \
  packages/agent-bundle/tests/prepack.test.ts \
  packages/agent-bundle/tests/route-register-typegen.test.ts \
  packages/agent-bundle/tests/route-invocation-dev-server.test.ts   # 3 files, 27 passed, 0 failed
pnpm test:packed                                                # 39 passed, 1 skipped (at pre-rebase head bce82913fa; no src change since)
pnpm docs:site:build                                            # ok (language parity, 0 broken links)

Deslop: Claude Fable 5.1, 0 edits (two-line test diff).

Self-review

Reviewer: GPT-5.6 Sol (medium), change-risk-reviewer, against the diff vs origin/main.

  • Assertion matches feat(events): pass preflight data to routes #664's contract: typegen omits only signal (src/routes/typegen.ts), production and harness forward preflight — confirmed, no product bug papered over.
  • No other shared-contract test asserts the old shape; route-graph.test.ts:1703 uses a fixture-local WorkspaceOpenInput — dismissed.
  • website/docs/{en,zh}/guide/development/testing.mdx still said { canonical, native } — fixed in this PR, pnpm docs:site:build green.
  • skip-changeset appropriate (tests + website only) — kept.

Second pass after the docs fix: no merge risks found.

@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 905e09b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy ScriptedAlchemy changed the title fix: green main after #656 and #664 (package-build staging watch, superseded test contracts) test(typegen): event-route inputs register the optional preflight key (#664 follow-up) Sep 6, 2026
@ScriptedAlchemy ScriptedAlchemy added the skip-changeset PR changes a publishable package but ships no observable change; changeset not required label Sep 6, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 6, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@670
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@670
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@670
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@670

commit: 81dbcf8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changeset PR changes a publishable package but ships no observable change; changeset not required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant